package com.biz.primus.ms.payment.trans;

import com.biz.primus.model.payment.vo.req.PaymentOrderReqVo;
import com.biz.primus.model.payment.vo.req.PaymentReqVo;
import java.util.function.Function;
import org.springframework.beans.BeanUtils;

/**
 * Created by defei on 9/27/17.
 */
public class PaymentReqVoToPaymentOrderReqVo implements Function<PaymentReqVo, PaymentOrderReqVo> {

    private String channelMchId;

    public PaymentReqVoToPaymentOrderReqVo(String channelMchId) {
        this.channelMchId = channelMchId;
    }

    @Override
    public PaymentOrderReqVo apply(PaymentReqVo paymentReqVo) {
        PaymentOrderReqVo reqVo = new PaymentOrderReqVo();
        BeanUtils.copyProperties(paymentReqVo, reqVo);
        reqVo.setChannelMchId(channelMchId);
        return reqVo;
    }
}
